<?php

namespace app\home\validate;

use think\Validate;

class Bindbanks extends Validate
{
    protected $rule =   [
        'id'  => 'require',
        'bankcard'  => 'require|length:16,19|number',
        'username'  => 'require',
        'idcard'  => 'require|length:18',
        'bankphone'  => 'require|length:11|number',
        'code'  => 'require|length:6|number',
        'bankname'  => 'require',
    ];

    protected $message  =   [
        'id.require' => '用户id不能为空',
        'bankcard.require' => '银行卡信息不能为空',
        'bankcard.length' => '银行卡长度错误',
        'bankcard.number' => '银行卡必须为纯数字',
        'username.require' => '银行卡绑定姓名不能为空',
        'idcard.require' => '身份证号不能为空',
        'idcard.length' => '身份证号长度错误',
        'bankphone.require' => '手机号不能为空',
        'bankphone.length' => '手机号格式错误',
        'bankphone.number' => '请输入纯数字手机号',
        'code.require' => '验证码不能为空',
        'code.length' => '验证码格式错误',
        'code.number' => '请输入数字验证码',
        'bankname.require' => '请填写银行名称',


    ];

    protected $scene = [
        'getbanklist' => ['id'],
        'addbank' => ['id','bankcard','bankname','idcard','phonenum','code','username'],

    ];
}
